#include "comm.hpp"
#include <iostream>

using namespace std;

int main()
{
    int fd = open(FIFO_FILE, O_WRONLY);
    if (fd < 0)
    {
        perror("open");
        exit(FIFO_OPEN_ERR);
    }
    cout << "client open file done" << endl;

    string msg;

    while (true)
    {
        cout << "Enter message: ";
        getline(cin, msg);

        write(fd, msg.c_str(), msg.size());     //ssize_t write(int fd, const void *buf, size_t count);
    }

    close(fd);
    return 0;
}